<?php
class QuotesModel extends CommonModel {
	public $_validate	=	array(
		//array('account','/^[a-z]\w{3,}$/i','帐号格式错误'),
		//array('password','require','密码必须'),
		//array('nickname','require','昵称必须'),
		//array('repassword','require','确认密码必须'),
	//	array('repassword','password','确认密码不一致',self::EXISTS_VAILIDATE,'confirm'),
		array('costname','','该费用类型已经存在',self::EXISTS_VAILIDATE,'unique',self::MODEL_INSERT),
		);

	public $_auto		=	array(
	    //array('prodid','prodid_id',self::MODEL_INSERT,'field'),
        //array('contid','contid_id',self::MODEL_INSERT,'field'),
		array('createtime','time',self::MODEL_INSERT,'function'),
        array('updatetime','time',self::MODEL_INSERT,'function'),
		array('updatetime','time',self::MODEL_UPDATE,'function'),
        array('qtime','chaqtime',self::MODEL_UPDATE,'callback'),
		);
        
    protected function chaqtime() {
		if(isset($_POST['qtime'])) {
			return strtotime($_POST['qtime']);
		}else{
			return false;
		}
	}
}
?>